package com.coastline.fruit.manage.controller;

import com.coastline.fruit.common.exception.CoastLineFruitException;
import com.coastline.fruit.manage.request.CreateOperatorReq;
import com.coastline.fruit.manage.response.CreateOperatorRsp;
import com.coastline.fruit.manage.service.OperatorService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author Coastline
 * @date 2025/1/26 21:50
 */
@Api(tags = "manage-操作员管理")
@Slf4j
@RestController
@RequestMapping("/coastline/fruit/v1/operator")
public class OperatorController {
    @Resource
    private OperatorService operatorService;

    @ApiOperation(value = "新增操作员")
    @PostMapping("/create")
    public CreateOperatorRsp createOperator(@RequestBody CreateOperatorReq createOperatorReq)
        throws CoastLineFruitException {
        return operatorService.createOperator(createOperatorReq);
    }
}
